package com.qf.Controller;

import com.qf.Servlet.Impl.UserServiceImpl;
import com.qf.pojo.Profile;
import com.qf.pojo.User;

import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.util.List;

/**
 * @author Wy
 * @version V1.0
 * @Project web人员管理系统
 * @Package com.qf.Controller
 * @Description:
 * @Date 2022/5/27 14:21
 */
@WebServlet("/user")
public class Fro  extends  BaseServlet {
    public String login(HttpServletRequest request, HttpServletResponse response){
        UserServiceImpl userService = new UserServiceImpl();
        List<Profile> all = userService.all();
        request.setAttribute("bookList",all);

        request.setAttribute("uname","lee");

        return "forward:/index.jsp";
    }


    public String delecte(HttpServletRequest request, HttpServletResponse response){
        String bookId = request.getParameter("bookId");
        UserServiceImpl userService = new UserServiceImpl();
        int delect = userService.delect(Integer.parseInt(bookId));

        return "redirect:/user?method=login";

    }
    public String  detail(HttpServletRequest request, HttpServletResponse response){
        UserServiceImpl userService = new UserServiceImpl();
        String id = request.getParameter("id");
        Profile logins = userService.logins(id);
        request.setAttribute("book",logins);

        return "forward:/111.jsp";



    }

}
